<div class="col-md-12 col-sm-12 col-xs-12">
    <div class="x_panel">
        <div class="x_title">
            <h2>{$pri_name} <small></small></h2>
            <ul class="nav navbar-right panel_toolbox">
                {:check_create('create')}
            </ul>
            <div class="clearfix"></div>
        </div>
        <div class="x_content" style="overflow: auto">
            <p class="text-muted font-13 m-b-30">
                <code>说明:</code>{$code}
            </p>

            <table id="example-advanced" class="table table-striped table-bordered ">
                <thead>
                <tr>
                    <th>
                        <input type="checkbox" onclick="CheckAll(this.checked)"></th>
                    </th>
                    <th>ID</th>
                    <th>{:substr($pri_name,0,-6)}名称</th>
                    <th>URL</th>
                    <!--<th>{:substr($pri_name,0,-6)}图标</th>-->
                    <!--<th>{:substr($pri_name,0,-6)}说明</th>-->
                    <th>层级</th>
                    <th>排序</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <form id="form_volist">
             {volist name="data" id="vo"}
                    <tr data-tt-id='{$vo.id}' {neq name="$vo.parent_id" value="0"}data-tt-parent-id='{$vo.parent_id}'{/neq}>

                    <th width="20">
                        <input type="checkbox" name="id[]" value="{$vo.id}"/>
                    </th>
                    <td width="15" align="center">{$vo.id}</td>
                    <td>{php}echo str_repeat('&nbsp&nbsp&nbsp',$vo['level']-1)."| -- ".$vo['pri_name']{/php}</td>
                    <td width="250">{$vo.url}</td>
                    <!--<td width="150">{$vo.icon}</td>-->
                    <!--<td width="150">{:strLength($vo.code,9,'')}</td>-->
                    <td width="50">{$vo.level}</td>
                    <td ><input style="border: none;" type="text" name="sort[{$vo.id}]" value="{$vo.sort}"></td>
                    <td width="50" align="center">
                        <label>
                            <input type="checkbox" class="js-switch" {eq name="$vo.status" value="1"}checked{/eq} onclick="Check('{:url(\'check\',[\'id\' => $vo[\'id\'],\'check\' => \'status'])}')" />
                        </label>
                    </td>
                    <td width="130">
                        {:check_update('update',['id' => $vo.id])}
                        {:check_destory('destory',['id' => $vo.id])}
                    </td>
                </tr>
                {/volist}
                </tbody>
                <tfoot align="left">
                <tr>
                    <td colspan="10">
                        <span>控制：</span>
                        <a style="color:#428BCA;cursor: pointer" onclick="index_update('{:url(\'index_update\')}')">更新排序</a>
                        <a style="color:#428BCA;cursor: pointer" onclick="delete_son('{:url(\'index_update\')}')">批量删除</a>
                    </td>
                </tr>
                </tfoot>
            </form>
            </table>
        </div>
    </div>
</div>
<script>
    function delete_son() {

        var isChecked = $('input[name=\'id[]\']:checked').is(':checked');
        if(!isChecked){
            layer.msg('请至少勾选一个选项');return;
        }
        $("input[name='id[]']:checked").each(function (k,v) {
            console.log(v.value);
            // alert(this.value);
            $.ajax({
                type: "POST", //用POST方式传输
                dataType: "json", //数据格式:JSON
                data:{id:this.value},
                url: "{:url('delete_son')}", //目标地址
                async: false,
                success: function (data) {
                    if(data.code == 400){
                        layer.msg(data.message);
                    }
                }
            });
        })
        layer.msg('批量删除成功');
        setTimeout(function () {
        history.go();
        },1000);

    }
</script>